using System.Collections.Generic;
using System.Linq;

namespace CHEnhanceEfCore.Common.Page
{
    public class Page<T>
    {
        public int pageNum { get; set; }
        public int pageSize { get; set; }
        public int total { get; set; }
        public List<T> records { get; set; }

        public void page()
        {
            records = records.Skip(getStartIndex()).Take(pageSize).ToList();
        }
        public int getStartIndex()
        {
            return (pageNum - 1) * pageSize;
        }
    }
}